package com.fangngng.pushall.mapper;

import com.fangngng.pushall.dto.RequestTopicVO;
import com.fangngng.pushall.dto.TopicAllVO;
import com.fangngng.pushall.dto.TopicQuery;
import com.fangngng.pushall.entity.Category;
import com.fangngng.pushall.entity.Topic;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.BaseMapper;

import java.util.List;

@Repository
@Mapper
public interface TopicMapper extends BaseMapper<Topic> {

    List<Topic> getHottest10Topic();

    List<Topic> getNewest10Topic();

    List<Topic> findAllTopics();

    /**
     * 查询所有需要提醒的主题
     * @return
     */
    List<TopicAllVO> findAllNeedRemindTopic();

    List<Topic> findByUserId(@Param("userId") Integer userId);

    List<Topic> findByUserName(@Param("userName") String userName);

    List<Topic> findTopic(@Param("request") RequestTopicVO topicVO);

    List<Topic> findByCondition(@Param("query") TopicQuery topicQuery);

    List<Topic> findSubscribeTopicByCondition(@Param("query") TopicQuery topicQuery);

    /**
     * 根据tag查找topic
     * @param tagId
     * @return
     */
    List<Topic> findTopicByTag(@Param("tagId") Integer tagId);

}